import java.util.Arrays;

public class Test1_1 {
    public static void moveZeroes(int[] nums) {
        for(int dest = -1, cur = 0; cur < nums.length; cur++) {
            if(nums[cur] != 0) {
                dest++;
                int tmp = nums[cur];
                nums[cur] = nums[dest];
                nums[dest] = tmp;
            }
        }
    }

    public static void main(String[] args) {
        int[] array = {1,0};
        moveZeroes(array);
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]);
            System.out.print(" ");
        }
        System.out.println(Arrays.toString(array));
    }
}
